package org.dromara.answer.domain.bo;

import org.dromara.answer.domain.AiUserAnswers;
import org.dromara.common.mybatis.core.domain.BaseEntity;
import org.dromara.common.core.validate.AddGroup;
import org.dromara.common.core.validate.EditGroup;
import io.github.linpeilie.annotations.AutoMapper;
import lombok.Data;
import lombok.EqualsAndHashCode;
import jakarta.validation.constraints.*;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;

/**
 * 用户答题记录业务对象 ai_user_answers
 *
 * @author Lion Li
 * @date 2025-04-09
 */
@Data
@EqualsAndHashCode(callSuper = true)
@AutoMapper(target = AiUserAnswers.class, reverseConvertGenerate = false)
public class AiUserAnswersBo extends BaseEntity {

    /**
     * 记录ID，主键
     */
    private Long recordId;

    /**
     * 用户ID
     */
    private Long userId;

    /**
     * 考试ID
     */
    @NotNull(message = "考试ID不能为空", groups = { AddGroup.class, EditGroup.class })
    private Long userExamId;

    /**
     * 题目ID
     */
    @NotNull(message = "题目ID不能为空", groups = { AddGroup.class, EditGroup.class })
    private Long questionId;

    /**
     * 题目类型，冗余字段便于查询
     */
    @NotBlank(message = "题目类型，冗余字段便于查询不能为空", groups = { AddGroup.class, EditGroup.class })
    private String questionType;

    /**
     * 用户答案内容：单选题/多选题存储选项label，填空题存储文本答案，判断题存储true/false
     */
    @NotBlank(message = "用户答案内容：用户答案内容：单选题/多选题存储选项label，填空题存储文本答案，判断题存储正确/错误不能为空", groups = { AddGroup.class, EditGroup.class })
    private String answerContent;

    /**
     * 作答时间
     */
    @NotNull(message = "作答时间不能为空", groups = { AddGroup.class, EditGroup.class })
    private Date answerTime;

    /**
     * 停留时间，单位秒
     */
    @NotNull(message = "停留时间不能为空", groups = { AddGroup.class, EditGroup.class })
    private Integer stayTime;

    /**
     * 是否正确：0-错误，1-正确
     */
    @NotNull(message = "是否正确：0-错误，1-正确不能为空", groups = { AddGroup.class, EditGroup.class })
    private Integer isCorrect;

    /**
     * 获得的分数
     */
    @NotNull(message = "获得的分数不能为空", groups = { AddGroup.class, EditGroup.class })
    private Integer scoreEarned;


}
